<?php
	class kyhantrabs
	{
		// Các trường
		public $MaKyHanTra = 0;
		public $TenKyHanTra = "";
		public $MaHinhThucVay = 0;
		
		// Các phương thức
		public function Them()
		{
			$db = new kyhantradb();
			return $db->Them($this->TenKyHanTra,
						     $this->MaHinhThucVay);
		}
		
		public function CapNhat()
		{
			$db = new kyhantradb();
			return $db->CapNhat($this->MaKyHanTra, 
								$this->TenKyHanTra,
								$this->MaHinhThucVay);
		}
		
		public function TonTaiTrongHopDongTinDung()
		{
			$db = new kyhantradb();
			return $db->TonTaiTrongHopDongTinDung($this->MaKyHanTra);
		}
		
		public function Xoa()
		{
			$db = new kyhantradb();
			return $db->Xoa($this->MaKyHanTra);
		}
		
		public function XoaTatCa()
		{
			$db = new kyhantradb();
			return $db->XoaTatCa();
		}
		
		public function LayDanhSach()
		{
			$db = new kyhantradb();
			return $db->LayDanhSach($this->MaKyHanTra,
									$this->TenKyHanTra,
									$this->MaHinhThucVay);
		}
	}
?>